#include <iostream>
#include <ctime>
#include <vector>
#include <cstdlib>

int const maxn = 200;
int const maxm = 300;
int map[maxn][maxn];
int father[maxn];
int n = 1000;

int get_father(int x)
{
	return (x == father[x]) ? x : father[x] = get_father(father[x]);
}


void set_union(int x, int y)
{
	int u = get_father(x);
	int v = get_father(y);
	if (u != v)
		father[u] =v;
}

int main()
{
	std::srand(std::time(0));
	for (int i = 1; i <= 4; i++) {
		std::cout << n << '\n';
		for (int i = 1; i < n; i++) {
			std::cout << "1 " << i + 1 << '\n';
		}

		std::cout << rand() % maxm + 1;
		for (int i = 1; i < n; i++)
			std::cout << ' ' << rand()% maxm + 1;
		std::cout << '\n';
	}
}

